library(e1071)
library(caret)

setwd("D:/ClassificationR")

#membaca data training & data testing
data.training = read.csv("titanic2class.train.1.csv")
data.test = read.csv("titanic2class.test.1.csv")

#proses 2
#membuat model 
model = naiveBayes(Survived~., data.training)

#proses 3
#melakukan prediksi
predict_result = predict(model, data.test[,-4])

#menghitung kinerja
performance.value = confusionMatrix(predict_result, data.test[,4], positive = "Yes")
print(performance.value)
